module sbox (y,d);
// Define the IO
input [6:1] d;
output [4:1] y;

// Define the output as a register
reg [4:1] y;

// Assign the permutations on any change in d
reg [2:1] r;
reg [4:1] c;

always @ d
begin
  r <= d[2:1];
  c <= d[6:3];
  
  // The remainder of the SBOX logic goes here

end
endmodule